#include<iostream>
using namespace std;
int main(){
	int n=0,x=100,k=1;
	cin>>n;
	while(1){
			if(52*(7*x+21*k)>n){
			x--;
		}else if(52*(7*x+21*k)<n){
			k++;
		}else {
			cout<<x<<endl;
	        cout<<k<<endl;
	        return 0;
		}
	}
	return 0;
}
